﻿require.config({
  urlArgs: "version=20170501",
  paths: {
    'jquery': '../packages/jquery-2.14-min',
    'bootstrap': '../../bootstrap/js/bootstrap.min',
  },
  shim: {
    'bootstrap': {
      deps: ['jquery'],
      exports: 'bootstrap'
    }
  }
});





require(['jquery','bootstrap'], function ($) {

var myChart = echarts.init(document.getElementById('content-right-classify1'));

$('#graph-8011').click(function () {
  	drawGraph_8011();
	  $('#graph-show').modal('show');
  });

$('#graph-8021').click(function () {
	  	drawGraph_8021();
		  $('#graph-show').modal('show');
	  });
$('#graph-8022').click(function () {
  	drawGraph_8022();
	  $('#graph-show').modal('show');
  });
$('#graph-8008').click(function () {
  	drawGraph_8008();
	  $('#graph-show').modal('show');
  });    
$('#graph-8031').click(function () {
  	drawGraph_8031();
	  $('#graph-show').modal('show');
  });  
$('#graph-8041').click(function () {
  	drawGraph_8041();
	  $('#graph-show').modal('show');
  });  
$('#graph-8071').click(function () {
  	drawGraph_8071();
	  $('#graph-show').modal('show');
  });  

$('#graph-8101').click(function () {
  	drawGraph_8101();
	  $('#graph-show').modal('show');
  });  

$('#graph-8111').click(function () {
  	drawGraph_8111();
	  $('#graph-show').modal('show');
  }); 

$('#graph-8121').click(function () {
  	drawGraph_8121();
	  $('#graph-show').modal('show');
  });

$('#graph-8122').click(function () {
	  	drawGraph_8122();
		  $('#graph-show').modal('show');
	  }); 
$('#graph-8141').click(function () {
	 drawGraph_8141();
	$('#graph-show').modal('show');
});
$('#graph-8015').click(function () {
		 drawGraph_8015();
		$('#graph-show').modal('show');
  });

  function drawGraph_8011() {
		/**
		 * ajax获取相应的数据
		 */
		$.ajaxSetup({
			async:false
		});
		var figdata;
		$.get("/ApplyAndAuthorize",function(data,status){
			figdata = data;
		    // alert("Data: " + data + "\nStatus: " + status);
		  });

		myChart.clear();
		
		option = {
				title:{
					text:'重点技术专利申请和授权趋势',
				},
			    tooltip : {
			        trigger: 'axis',
			        axisPointer : {            // 坐标轴指示器，坐标轴触发有效
			            type : 'shadow'        // 默认为直线，可选为：'line' | 'shadow'
			        }
			    },
			    legend: {
			        data: ['专利申请量', '专利授权量'],
			    	left:'right'
			    },
			    grid: {
			        left: '3%',
			        right: '4%',
			        bottom: '10%',
			        containLabel: true
			    },
			    yAxis:  {
			        type: 'value'
			    },
			    xAxis: {
			        type: 'category',
			        data: figdata.xAxis,
			        axisLabel:{  
			            interval: 0,
				    	rotate:-30,//倾斜度 -90 至 90 默认为0  
			        },
			    },
			    series: [
			        {
			            name: '专利申请量',
			            type: 'line',
			            label: {
			                normal: {
			                    //show: true,
			                    position: 'insideRight'
			                }
			            },
			            data: figdata.yValue1
			        },
			        {
			            name: '专利授权量',
			            type: 'bar',
			            label: {
			                normal: {
			                    //show: true,
			                    position: 'insideRight'
			                }
			            },
			            data: figdata.yValue2
			        }
			    ]
			};
		 myChart.setOption(option);
	}

 function drawGraph_8021() {
		/**
		 * ajax获取相应的数据
		 */
		$.ajaxSetup({
			async:false
		});
		var figdata;
		$.get("/KeyTechLawStatus",function(data,status){
			figdata = data;
		    // alert("Data: " + data + "\nStatus: " + status);
		  });

		myChart.clear();
		
		option = {
				title:{
					text:'重点专利法律状态',
				},
			    tooltip : {
			        trigger: 'axis',
			        axisPointer : {            // 坐标轴指示器，坐标轴触发有效
			            type : 'shadow'        // 默认为直线，可选为：'line' | 'shadow'
			        }
			    },
			    legend: {
			        data: ['审查中的专利', '失效专利','有效专利'],
			    	left:'right'
			    },
			    grid: {
			        left: '3%',
			        right: '4%',
			        bottom: '10%',
			        containLabel: true
			    },
			    yAxis:  {
			        type: 'value'
			    },
			    xAxis: {
			        type: 'category',
			        data: figdata.xAxis,
			        axisLabel:{  
			            interval: 0,
				    	rotate:-30,//倾斜度 -90 至 90 默认为0  
			        },
			    },
			    series: [
			        {
			            name: '审查中的专利',
			            type: 'bar',
			            stack: '总量',
			            label: {
			                normal: {
			                    //show: true,
			                    position: 'insideRight'
			                }
			            },
			            data: figdata.yValue1
			        },
			        {
			            name: '失效专利',
			            type: 'bar',
			            stack: '总量',
			            label: {
			                normal: {
			                    //show: true,
			                    position: 'insideRight'
			                }
			            },
			            data: figdata.yValue2
			        },
			        {
			            name: '有效专利',
			            type: 'bar',
			            stack: '总量',
			            label: {
			                normal: {
			                    //show: true,
			                    position: 'insideRight'
			                }
			            },
			            data: figdata.yValue3
			        }
			    ]
			};
		 myChart.setOption(option);
	}
 function drawGraph_8022() {
		$.ajaxSetup({async:false});
		var figdata;
		$.get("/KeyTechLawStatusByStatus",function(adata,status){
			figdata = adata;
		    //alert("Data: " + data + "\nStatus: " + status);
		  });
		myChart.clear();
		
		option = {
	        title: {
	            text: '重点专利法律状态（汇总）'
	        },
	        tooltip: {},
	        legend: {
	            //data:['专利申请量／件']
	        },
	        xAxis: {
		        type: 'category',
		        data: figdata.xAxis,
		        axisLabel:{  
		            interval: 0,
		        },
		    },
	        yAxis: {},
	        series: [{
	            name: '数量',
	            type: 'bar',
	            itemStyle: {
                    normal: {
                         color: function(params) {
                         // build a color map as your need.
	                         var colorList = ['#0080FF','#C1232B','#00EC00'];
	                         return colorList[params.dataIndex]
                         },
          　　　　　　　　　　　　　　//以下为是否显示，显示位置和显示格式的设置了
                        label: {
                           show: true,
                           position: 'top',
//                                       formatter: '{c}'
                           formatter: '{b}\n{c}'
                        }
                    }
                },
	            data: figdata.yValue
	        }]
	    };
		 myChart.setOption(option);
	}
 
 
function drawGraph_8031() {
		/**
		 * ajax获取相应的数据
		 */
		$.ajaxSetup({
			async:false
		});
		var figdata;
		$.get("/CountryApplyOrder",function(adata,status){
			figdata = adata;
		    //alert("Data: " + data + "\nStatus: " + status);
		  });
		myChart.clear();
		
		option = {
	        title: {
	            text: '重点技术国家/地区专利申请量排名(前10位)'
	        },
	        tooltip: {},
	        legend: {
	            data:['专利申请量／件'],
	    		left:'right'
	        },
	        xAxis: {
		        type: 'category',
		        data: figdata.xAxis,
		        axisLabel:{  
		            interval: 0,
			    	rotate:-30,//倾斜度 -90 至 90 默认为0  
		        },
		    },
	        yAxis: {},
	        series: [{
	            name: '专利申请量／件',
	            type: 'bar',
	            data: figdata.yValue
	        }]
	    };
		 myChart.setOption(option);
	}

 function drawGraph_8041() {
		/**
		 * ajax获取相应的数据
		 */
		$.ajaxSetup({
			async:false
		});
		
		var figdata;
		$.get("/CountryApplyOrderYearTrend",function(data,status){
			figdata = data;
		    // alert("Data: " + data + "\nStatus: " + status);
		  });

		myChart.clear();
		
		option = {
				title:{
					text:'重点技术专利申请量排名前10位国家/地区的年度申请趋势',
				},
			    tooltip : {
			        trigger: 'axis',
			        axisPointer : {            // 坐标轴指示器，坐标轴触发有效
			            type : 'shadow'        // 默认为直线，可选为：'line' | 'shadow'
			        }
			    },
			    legend: {
			        data: figdata.blegend,
			    	left:'right',
			    	orient:'horizontal',
			    	bottom:'0.5%'
			    },
			    grid: {
			        left: '3%',
			        right: '4%',
			        bottom: '10%',
			        containLabel: true
			    },
			    yAxis:  {
			        type: 'value'
			    },
			    xAxis: {
			        type: 'category',
			        data: figdata.xAxis,
			        axisLabel:{  
			            interval: 0,
				    	rotate:-30,//倾斜度 -90 至 90 默认为0  
			        },
			    }
			};
		var series = Array();
		for(var i=0;i<10;i++){
			series[i] = new Object();
			eval("series["+i+"].name = figdata.blegend["+i+"]");
			eval("series["+i+"].type = 'bar'");
			eval("series["+i+"].stack = '总量'");
			eval("series["+i+"].data = figdata.valueY"+i);
		}
		option.series = series;

		myChart.setOption(option);
	}
 
 function drawGraph_8071() {
		$.ajaxSetup({async:false});

		var figdata;
		$.get("/SourceMarket",function(data,status){figdata = data;});

		myChart.clear();

	var data = new Array()
	var k;
	var maxcount = 0
	var maxdiameter = 80
	for(i=0;i<5;i++){
		data[i] = new Array();
		eval("k = figdata.valueY"+i+".length");
		for(j=0;j<k;j++){
			var t;
			eval("t = parseInt(figdata.valueY"+i+"["+j+"])")
			if(t>maxcount) maxcount = t
			data[i][j] = [j,i,t]
		}
	}
	option = {
	    title: {
	        text: '五大技术来源国市场分布(美、欧、日、中、韩)'
	    },
	    xAxis: {
	    	type:'category',
	    	data:figdata.xAxis,
	        splitLine: {
	            lineStyle: {
	                type: 'dashed'
	            }
	        }
	    },
	    yAxis: {
	    	type:'category',
		    data:figdata.yAxis,
	        splitLine: {
	            lineStyle: {
	                type: 'dashed'
	            }
	        },
	        scale: true
	    },
	    series: [{
	        //name: '1990',
	        data: data[0],
	        type: 'scatter',
	        symbolSize: function (data) {
	            return data[2]/maxcount*maxdiameter;
	        },
	        label: {
	            emphasis: {
	                show: true,
	                formatter: function (param) {
	                    return param.data[3];
	                },
	                position: 'top'
	            }
	        }
	    }, {
	        data: data[1],
	        type: 'scatter',
	        symbolSize: function (data) {
	            return data[2]/maxcount*maxdiameter ;
	        },
	        label: {
	            emphasis: {
	                show: true,
	                formatter: function (param) {
	                    return param.data[3];
	                },
	                position: 'top'
	            }
	        }
	    }
	    ]
	};
		myChart.setOption(option);
	}
function drawGraph_8008() {
	
	/**
	 * ajax获取相应的数据
	 */
	$.ajaxSetup({
		async:false
	});
	var figdata;
	$.get("/ProvApplyOrder",function(adata,status){
		figdata = adata;
	    //alert("Data: " + data + "\nStatus: " + status);
	  });
	myChart.clear();
	
	option = {
        title: {
            text: '中国各省份专利申请量排名（前20位）'
        },
        tooltip: {},
        legend: {
            data:['专利申请量／件']
        },
        xAxis: {
	        type: 'category',
	        data: figdata.xAxis,
	        axisLabel:{  
	            interval: 0,
		    	rotate:-30,//倾斜度 -90 至 90 默认为0  
	        },
	    },
        yAxis: {},
        series: [{
            name: '专利申请量／件',
            type: 'bar',
            data: figdata.yValue
        }]
    };
	 myChart.setOption(option);
}

function drawGraph_8015() {
	/**
	 * ajax获取相应的数据
	 */
	$.ajaxSetup({
		async:false
	});
	var figdata;
	$.get("/T10PatLawState",function(data,status){
		figdata = data;
	    // alert("Data: " + data + "\nStatus: " + status);
	  });

	myChart.clear();
	
	option = {
			title:{
				text:'排名前10位发明人的专利法律状态',
			},
		    tooltip : {
		        trigger: 'axis',
		        axisPointer : {            // 坐标轴指示器，坐标轴触发有效
		            type : 'shadow'        // 默认为直线，可选为：'line' | 'shadow'
		        }
		    },
		    legend: {
		        data: ['审查中的专利', '失效专利','有效专利'],
		    	left:'right'
		    },
		    grid: {
		        left: '3%',
		        right: '4%',
		        bottom: '10%',
		        containLabel: true
		    },
		    yAxis:  {
		        type: 'value'
		    },
		    xAxis: {
		        type: 'category',
		        data: figdata.xAxis,
		        axisLabel:{  
		            interval: 0,
			    	rotate:-30,//倾斜度 -90 至 90 默认为0  
		        },
		    },
		    series: [
		        {
		            name: '审查中的专利',
		            type: 'bar',
		            stack: '总量',
		            label: {
		                normal: {
		                    show: true,
		                    position: 'insideRight'
		                }
		            },
		            data: figdata.yValue1
		        },
		        {
		            name: '失效专利',
		            type: 'bar',
		            stack: '总量',
		            label: {
		                normal: {
		                    show: true,
		                    position: 'insideRight'
		                }
		            },
		            data: figdata.yValue2
		        },
		        {
		            name: '有效专利',
		            type: 'bar',
		            stack: '总量',
		            label: {
		                normal: {
		                    show: true,
		                    position: 'insideRight'
		                }
		            },
		            data: figdata.yValue3
		        }
		    ]
		};
	 myChart.setOption(option);
}


function drawGraph_8002() {
	myChart.clear();
	var xAxisData = [];
	var data1 = [];
	var data2 = [];
	for (var i = 0; i < 100; i++) {
	    xAxisData.push('类目' + i);
	    data1.push((Math.sin(i / 5) * (i / 5 -10) + i / 6) * 5);
	    data2.push((Math.cos(i / 5) * (i / 5 -10) + i / 6) * 5);
	}
		option = {
			    title: {
			        text: '柱状图动画延迟'
			    },
			    legend: {
			        data: ['bar', 'bar2'],
			        align: 'left'
			    },
			    toolbox: {
			        // y: 'bottom',
			        feature: {
			            magicType: {
			                type: ['stack', 'tiled']
			            },
			            dataView: {},
			            saveAsImage: {
			                pixelRatio: 2
			            }
			        }
			    },
			    tooltip: {},
			    xAxis: {
			        data: xAxisData,
			        silent: false,
			        splitLine: {
			            show: false
			        }
			    },
			    yAxis: {
			    },
			    series: [{
			        name: 'bar',
			        type: 'bar',
			        data: data1,
			        animationDelay: function (idx) {
			            return idx * 10;
			        }
			    }, {
			        name: 'bar2',
			        type: 'bar',
			        data: data2,
			        animationDelay: function (idx) {
			            return idx * 10 + 100;
			        }
			    }],
			    animationEasing: 'elasticOut',
			    animationDelayUpdate: function (idx) {
			        return idx * 5;
			    }
			};
		 myChart.setOption(option);
	}


function drawGraph_8101() {
	/**
	 * ajax获取相应的数据
	 */
	$.ajaxSetup({
		async:false
	});
	
	var figdata;
	$.get("/ProvApplyYearTrend",function(data,status){
		figdata = data;
	    // alert("Data: " + data + "\nStatus: " + status);
	  });

	myChart.clear();
	
	option = {
			title:{
				text:'排名前10位省份的专利年度申请趋势',
			},
		    tooltip : {
		        trigger: 'axis',
		        axisPointer : {            // 坐标轴指示器，坐标轴触发有效
		            type : 'shadow'        // 默认为直线，可选为：'line' | 'shadow'
		        }
		    },
		    legend: {
		        data: figdata.blegend,
		    	left:'right',
		    	orient:'horizontal',
		    	bottom:'0.5%'
		    },
		    grid: {
		        left: '3%',
		        right: '4%',
		        bottom: '10%',
		        containLabel: true
		    },
		    yAxis:  {
		        type: 'value'
		    },
		    xAxis: {
		        type: 'category',
		        data: figdata.xAxis,
		        axisLabel:{  
		            interval: 0,
			    	rotate:0,//倾斜度 -90 至 90 默认为0  
		        },
		    }
		};
	var series = Array();
	for(var i=0;i<10;i++){
		series[i] = new Object();
		eval("series["+i+"].name = figdata.blegend["+i+"]");
		eval("series["+i+"].type = 'line'");
		//eval("series["+i+"].stack = '总量'");
		eval("series["+i+"].data = figdata.valueY"+i);
	}
	option.series = series;

	myChart.setOption(option);
}

function drawGraph_8111() {
	$.ajaxSetup({async:false});
	var figdata;
	$.get("/Top20ApplyInst",function(adata,status){figdata = adata;});
	myChart.clear();
	
	option = {
        title: {
            text: '专利申请量排名前20位企业/研发机构'
        },
        tooltip: {},
        legend: {
            data:['专利申请量／件'],
    		left:'right'
        },
        xAxis: {},
        yAxis: {
	        type: 'category',
	        data: figdata.xAxis.reverse(),
	        axisLabel:{  
	            interval: 0
	        },
	     },
        series: [{
            name: '专利申请量／件',
            type: 'bar',
            data: figdata.yValue.reverse()
        }]
    };
	 myChart.setOption(option);
}

function drawGraph_8121() {
	$.ajaxSetup({async:false});

	var figdata;
	$.get("/InstApplyTrend",function(data,status){
		figdata = data;
	    // alert("Data: " + data + "\nStatus: " + status);
	  });

	myChart.clear();
	
	option = {
			title:{
				text:'排名前10位企业/研发机构的专利申请趋势',
			},
		    tooltip : {
		        trigger: 'axis',
		        axisPointer : {            // 坐标轴指示器，坐标轴触发有效
		            type : 'shadow'        // 默认为直线，可选为：'line' | 'shadow'
		        }
		    },
		    legend: {
		        data: figdata.blegend,
		    	left:'right',
		    	orient:'horizontal',
		    	bottom:'0.5%'
		    },
		    grid: {
		        left: '3%',
		        right: '4%',
		        bottom: '10%',
		        containLabel: true
		    },
		    yAxis:  {
		        type: 'value'
		    },
		    xAxis: {
		        type: 'category',
		        data: figdata.xAxis,
		        axisLabel:{  
		            interval: 0,
			    	rotate:0,//倾斜度 -90 至 90 默认为0  
		        },
		    }
		};
	var series = Array();
	for(var i=0;i<10;i++){
		series[i] = new Object();
		eval("series["+i+"].name = figdata.blegend["+i+"]");
		eval("series["+i+"].type = 'line'");
		//eval("series["+i+"].stack = '总量'");
		eval("series["+i+"].data = figdata.valueY"+i);
	}
	option.series = series;

	myChart.setOption(option);
}

function drawGraph_8141() {
	/**
	 * ajax获取相应的数据
	 */
	$.ajaxSetup({
		async:false
	});
	var figdata;
	$.get("/T20InventorApply",function(adata,status){
		figdata = adata;
	    //alert("Data: " + data + "\nStatus: " + status);
	  });
	myChart.clear();
	
	option = {
        title: {
            text: '专利申请量排名前20位发明人'
        },
        tooltip: {},
        legend: {
            data:['专利申请量／件'],
    		left:'right'
        },
        xAxis: {
	    },
        yAxis: {
	        type: 'category',
	        data: figdata.xAxis.reverse(),
	        axisLabel:{  
	            interval: 0,
		    	rotate:0,//倾斜度 -90 至 90 默认为0  
	        },},
        series: [{
            name: '专利申请量／件',
            type: 'bar',
            data: figdata.yValue.reverse()
        }]
    };
	 myChart.setOption(option);
}

function drawGraph_8122() {
	$.ajaxSetup({async:false});

	var figdata;
	$.get("/InstApplyTrendStack",function(data,status){
		figdata = data;
	    // alert("Data: " + data + "\nStatus: " + status);
	  });

	myChart.clear();
	
	option = {
			title:{
				text:'排名前10位企业/研发机构的专利申请趋势',
			},
		    tooltip : {
		        trigger: 'axis',
		        axisPointer : {            // 坐标轴指示器，坐标轴触发有效
		            type : 'shadow'        // 默认为直线，可选为：'line' | 'shadow'
		        }
		    },
		    legend: {
		        data: figdata.blegend,
		    	left:'right',
		    	orient:'horizontal',
		    	bottom:'0.5%'
		    },
		    grid: {
		        left: '3%',
		        right: '4%',
		        bottom: '10%',
		        containLabel: true
		    },
		    yAxis:  {
		        type: 'value'
		    },
		    xAxis: {
		        type: 'category',
		        data: figdata.xAxis,
		        axisLabel:{  
		            interval: 0,
			    	rotate:0,//倾斜度 -90 至 90 默认为0  
		        },
		    }
		};
	var series = Array();
	for(var i=0;i<10;i++){
		series[i] = new Object();
		eval("series["+i+"].name = figdata.blegend["+i+"]");
		eval("series["+i+"].type = 'bar'");
		eval("series["+i+"].stack = '总量'");
		eval("series["+i+"].data = figdata.valueY"+i);
	}
	option.series = series;

	myChart.setOption(option);
}

});

